/*
   Copyright [2013] [szhu1@umbc.edu]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
*/
package szhu.hcc.umbc.crowdsourcing.quality.core;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * Data Entry class to support data analyzing.
 *
 * @author szhu1@umbc.edu
 */
public class RawData {
    public int taskId;
    public String workerId;
    /**
     * If quality is negative, then the quality if BAD, if 0, the quality is neutral, if positive, then good
     */
    public int quality;
    public List<Double> taskNatures;
    public List<Double> userEfforts;
    /**
     * Specially created for gaming analysis purpose
     */
    public boolean simulated;

    public RawData(int taskId, String workerId, int quality, List<Double> taskNatures, List<Double> userEfforts) {
        this.taskId = taskId;
        this.workerId = workerId;
        this.quality = quality;
        this.taskNatures = new ArrayList<>(taskNatures);
        this.userEfforts = new ArrayList<>(userEfforts);
    }

    @Override
    public String toString() {
        return String.format(
                "{[taskId: %s]; [workerId: %s]; [quality: %s]; [taskNatures: %s]; [userEfforts: %s]; [simulated: %s]}",
                taskId, workerId, quality, Arrays.toString(taskNatures.toArray()), Arrays.toString(userEfforts.toArray()),
                simulated);
    }
}
